<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../include/top.jsp" %>
<%@ include file="../include/errorArea.jsp" %>

<table width="98%" border="0" align="center" cellpadding="4" cellspacing="1">
  <tr> 
    <td align="center">
    	<input type="button" class="button cyan medium" value="回复" onclick="$('#replyContent').focus();window.location='#toReply';"/>
    	<input type="button" class="button cyan medium" value="刷新" onclick="location.reload(true);"/>
		<input type="button" class="button cyan medium" value="返回列表" onclick="window.location='listTopic'"/>
    </td>
  </tr>
</table>

<table width="98%" align="center" border="0" cellpadding="4" cellspacing="0" style="table-layout:fixed;word-break:break-all">
  <tr class="bbsTableHeaderLeftAlign"> 
    <td width="125"><b>发表人</b></td>
    <td align><b>主题：${topic.topicTitle}</b></td>
  </tr>
  <tr> 
    <td valign="top" class="bbsTableOddRow"><b>${topic.fromName}</b><br>
    </td>
    <td valign="top" class="bbsTableOddRow">
	    <span style="float:right;width:60px;color:#B8C5B8;text-align:center;font:bold 20px 'Verdana';border: 1px solid;">1F</span>
	     
	      发表于 <fmt:formatDate value="${topic.addTime}" pattern="yyyy/MM/dd HH:mm:ss"/> 
	      
	      <hr size="1" noshade><c:out escapeXml="false" value="${topic.topicContent}"/><br><br>
      </td>
  </tr>
  <c:forEach var="reply" items="${replyList}" varStatus="sta">
  <tr  class="bbsTableEvenRow"> 
    <td valign="top" ><b>${reply.fromName}</b><br>
    </td>
    <td valign="top">
	    <span style="float:right;width:60px;color:#B8C5B8;text-align:center;font:bold 20px 'Verdana';border: 1px solid;">${sta.count+1}F</span>
	      发表于  <fmt:formatDate value="${reply.addTime}" pattern="yyyy/MM/dd HH:mm:ss"/>
	      <hr size="1" noshade><c:out escapeXml="false" value="${reply.replyContent}"/><br><br>
      </td>
  </tr>
  </c:forEach>
</table>
<br>
<!-----------------------------------发帖表单---------------------------------->
<form action="${ctx}/forumO2C/saveReply" method="post" name="myForm" id="myForm" onsubmit="return checkInput();">
<input type="hidden" name="replyId" value="0"/>
<input type="hidden" name="topicId" value="${topic.topicId}"/>
<a name="toReply"></a>
<TABLE width="98%" border="0" align="center" cellPadding="4" cellSpacing="0">
<tr class="bbsTableHeaderLeftAlign"> 
  <TD width="110" ><B>快速回复：</B></TD>
  <TD></TD>
</TR>
<TR> 
  <TD align="right" vAlign="top" noWrap><B>内容：</B> 
 </TD>
  <TD vAlign="top">
  		 <link rel="stylesheet" href="${baseURL}/kindeditor417/themes/default/default.css" />
			<link rel="stylesheet" href="${baseURL}/kindeditor417/plugins/code/prettify.css" />
			<script charset="utf-8" src="${baseURL}/kindeditor417/kindeditor-all-min.js"></script>
			<script charset="utf-8" src="${baseURL}/kindeditor417/lang/zh_CN.js"></script>
			<script charset="utf-8" src="${baseURL}/kindeditor417/plugins/code/prettify.js"></script>
			<script>
				KindEditor.ready(function(K) {
					editor1 = K.create('textarea[name="replyContent"]', {
						cssPath : '${baseURL}/kindeditor417/plugins/code/prettify.css',
						uploadJson : '${baseURL}/kindeditor417/jsp/upload_json.jsp',
						fileManagerJson : '${baseURL}/kindeditor417/jsp/file_manager_json.jsp',
						allowFileManager : false,
						afterCreate : function() {
							var self = this;
							K.ctrl(document, 13, function() {
								self.sync();
								K('form[name=myForm]')[0].submit();
							});
							K.ctrl(self.edit.doc, 13, function() {
								self.sync();
								K('form[name=myForm]')[0].submit();
							});
						}
					});
					prettyPrint();
				});
			</script>
  <TEXTAREA class="myinput" name="replyContent" id="replyContent" rows="10" wrap="VIRTUAL" cols="80"></TEXTAREA></TD>
</TR>
<TR align="center"> 
  <TD colspan="2" vAlign="top" "noWrap">
  <input type="submit" class="button cyan medium" value="发表回复" onclick="editor1.sync()"/>
  </TD>
</TR>
</TABLE>
</form>
<script>
function checkInput(){
	if($("#replyContent").val()==""){
		$("#replyContent").focus();
		alert("请输入回复内容");
		return false;
	}
	return true;
}
</script>
<%@ include file="../include/bottom.jsp" %>